﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="refresh" content="90000">
    <title>KM报表平台</title>
    <link href="css/global.css" rel="stylesheet" type="text/css" />
    <link href="css/index.css?1212" rel="stylesheet" type="text/css" />
    <script src="./js/jquery/jquery-1.8.1.min.js" type="text/javascript"></script>
    <script src="js/jquery/jquery.iDialog.js" dialog-theme="default" type="text/javascript"></script>
    <script src="mobile/js/Toast.js" type="text/javascript"></script>
    <script src="js/config.js" type="text/javascript"></script>
    <script type="text/javascript">
        window.onbeforeunload = onbeforeunload_handler;
        function onbeforeunload_handler() {
            var warning = "KM报表平台-提示消息";
            return warning;
        }
        var uppwd = false;
        $(function () {
            GetOnline();
            var time = 10000;

            var interval; //调度器对象。
            run();
            function run() {
                interval = setInterval(GetOnline, time);
            }

            $(".a_menu").live("click", function () {
                //alert($(this).attr("url"));
                $(this).parent().parent().find('a').removeClass("a_bg");
                $(this).addClass("a_bg");
                //$("#if_main").attr("src", $(this).attr("url"));
                OpenTags($(this).attr("mid"), $(this).attr("title"), $(this).attr("url"))
            });

            function OpenTags(id, name, url) {
                //alert($("#TopMenu ul li").length);
                if ($("#TopMenu ul li").length > 9) {
                    alert("页签最多只能打开10个，请关闭！");
                    return;
                }
                if ($("#tag" + id).length == 0) {
                    //如果当前元素不存在，就创建页签
                    CreateTags(id, name, url);
                }
                ShowTags(id);
            }
            function ShowTags(id) {
                //隐藏所有页签
                $(".tags").removeClass("active");
                $(".conents").css("display", "none");
                //显示当前页签
                $("#tag" + id).addClass("active");
                $("#c_" + id).css("display", "block");
                $("#tag" + id).show();
            }
            function CreateTags(id, name, url) {
                //增加或删除标签
                var tagMenu = document.createElement("li");
                tagMenu.id = "tag" + id;
                tagMenu.setAttribute("class", 'tags');
                tagMenu.onclick = function (evt) {
                    ShowTags(id);
                }
                tagMenu.innerHTML = name + "   " + "<img class='clsbtn' pid='" + id + "' src='./images/colose.png' style='vertical-align:middle'/>";
                $("#TopMenu ul").append(tagMenu);
                //$("#TopMenu ul").appendChild("afdafd");
                if ($("#c_" + id).length == 0) {
                    $(".contentsidebar_box").append("<div id='c_" + id + "' class='conents'>"
                    + "<iframe src='" + url + "'></iframe></div>");
                } else {
                    $("#c_" + id).find("iframe").attr('src', url);
                }
            }
            //标签关闭事件。
            $(".clsbtn").live("click", function () {
                $("#tag" + $(this).attr("pid")).remove();
                $("#c_" + $(this).attr("pid")).css("display", "none");
                $('#TopMenu ul').children('li:last-child').click();
            });
            $("#btn_center").live("click", function () {
                OpenTags('0', '个人信息', 'MyCenter.aspx')
            });

            $("#pageindex").live("click", function () {
                $(".tags").removeClass("active");
                $(".conents").css("display", "none");
                $(this).addClass("active");
                $("#c_index").css("display", "block");

                $(this).show();
            });
            $("#btnOut").live("click", function () {
                LoginOut();
            });

            $("#lblUserName").hover(function () {
                $('.ow_menu').show();
                $(".ow_menu").hover(function () {
                    $('.ow_menu').show();
                }, function () {
                    $('.ow_menu').hide();
                });
            })
            $.post(url_path + "/index.aspx",
                    { aciton: 'GetUser' },
                     function (data) {
                         var msg = $.trim(data);
                         if (msg == "NOUSER") {
                             alert("登录信息过期，请重新登录！");
                             window.location.href = 'login.html';
                         } else {
                             var orderObj = JSON.parse(msg);
                             for (var i = 0; i < orderObj.length; i++) {
                                 $("#lblUserName").text(orderObj[i].UserName);
                                 var usercode = orderObj[i].UserCode;
                                 if (orderObj[i].UpPwd == "False") {
                                     iDialog({
                                         lock: true,
                                         fixed: true,
                                         closed: false,
                                         title: '修改用户密码',
                                         width: 300,
                                         btn: {
                                             ok: {
                                                 val: '确定',
                                                 type: 'blue',
                                                 click: function (btn) {
                                                     if ($("#txtpwd").val().trim() == "") {
                                                         showtoast("密码不能为空！", null, null, 100);
                                                         return false;
                                                     }
                                                     if ($("#txtpwd").val().trim() != $("#txtpwd2").val().trim()) {
                                                         showtoast("两次密码输入不一致！", null, null, 100);
                                                         return false;
                                                     }
                                                     first_uppwd(usercode, $("#txtpwd").val());
                                                     uppwd = true;
                                                     this.hide();
                                                 }
                                             }
                                         },
                                         hide: function () {
                                             if (uppwd == false)
                                                 return false;
                                             else return true;
                                         },
                                         content: document.getElementById("up_pwd")
                                     });
                                 }
                             }
                         }
                     });
        });
        //简洁菜单移动效果
        $(function () {
            LoadMenu();
        });
        function first_uppwd(usercode, pwd1) {
            $.ajax({
                url: url_path + "/index.aspx",
                type: "POST",
                data: { aciton: 'first_uppwd', UserCode: usercode, Pwd: pwd1 },
                dataType: "json",
                success: function (data) {
                    if (data.status == '0') {
                        showtoast("修改失败！", null, null, null);
                    } else {
                        showtoast("修改成功！", null, null, null);
                        //window.location.href = 'login.html';
                        uppwd = true;
                    }
                },
                error: function () {

                }
            });
        }
        function GetOnline() {
            //                $.get(url_path + "/index.aspx",
            //                    { aciton: 'GetOnline' },
            //                    function (data) {
            //                        var msg = $.trim(data);
            //                        $("#txtonline").text("当前在线人数：" + msg + "人");
            //                    });

            $.ajax({
                url: url_path + "/index.aspx",
                type: "POST",
                data: { aciton: 'GetOnline' },
                dataType: "text",
                success: function (data) {
                    var msg = $.trim(data);
                    $("#txtonline").text("当前在线人数：" + msg + "人");
                    if (msg == "0") {
                        alert("登录已超时，请重新登录！");
                        window.location.href = 'login.html';
                    }
                },
                error: function () {

                }
            });
        }
        function LoginOut() {
            $.post(url_path + "/index.aspx",
                    { aciton: 'LoginOut' },
                    function (data) {
                        var msg = $.trim(data);
                        localStorage.removeItem("UserID");
                        localStorage.removeItem("UserCode");
                        localStorage.removeItem("UserName");
                        window.location.href = 'login.html';
                    });
        }
        function LoadMenu() {
            var modulename = '';
            $("#lod_menu").show();
            $.post(url_path + "/index.aspx",
                { aciton: 'LoadMenu' },
                function (data) {
                    var msg = $.trim(data);
                    var orderObj = JSON.parse(msg);
                    var menu_html = '<div style="margin-left: 18px; height: 25px; padding: 5px; text-align: center;"> '
                    + '<span style="font-size: 18px; color: White;">功能菜单</span> <a id="btn_l" href="#" style="padding-left: 55px;'
                     + 'color: White;"><</a></div>';

                    var menu_html2 = "";
                    var chil_html = "";
                    var chil_html2 = "";

                    for (var i = 0; i < orderObj.length; i++) {
                        menu_html += ' <dl class="statistics' + orderObj[i].mindx + '">'
                        + '<dt onclick="changeImage()">' + orderObj[i].modulename + '<img src="images/left/select_xl01.png"></dt>';

                        menu_html2 += '<li><a class="j_a_list j_a_list' + orderObj[i].mindx + '"></a>'
                        + '<div class="j_menu_list j_menu_list_first" style="display: none;">'
                          + ' <span class="sp1"><i></i>' + orderObj[i].modulename + '</span>';

                        chil_html = "";
                        chil_html2 = "";

                        var ChildObj = orderObj[i].childNode;
                        if (ChildObj != undefined) {
                            for (var j = 0; j < ChildObj.length; j++) {
                                if (ChildObj[j].modulename.length > 8) {
                                    modulename = ChildObj[j].modulename.substring(0, 7) + '...';
                                } else {
                                    modulename = ChildObj[j].modulename
                                }
                                chil_html += '<dd ' + (ChildObj[j].mindx == '1' ? 'class="first_dd"' : '') + '>'
                            + ' <a class="a_menu" title="' + ChildObj[j].modulename + '" href="#" mid="' + ChildObj[j].mid + '" url="' + ChildObj[j].weburl + '?mid=' + ChildObj[j].mid + '">' + modulename + '</a></dd>';
                                chil_html2 += '<a class=" a_menu j_lista_first" title="' + ChildObj[j].modulename + '" href="#" mid="' + ChildObj[j].mid + '" url="'
                            + ChildObj[j].weburl + '?mid=' + ChildObj[j].mid + '">' + modulename + '</a>';
                            }
                        }
                        menu_html += chil_html + '</dl>';
                        menu_html2 += chil_html2;
                    }
                    $(".leftsidebar_box").html(menu_html);
                    $("#menu_ul").html(menu_html2);

                    $(".j_menu_list").hide();
                    $(".j_a_list").hover(function () {
                        $(".leftmenu2 ul li").hover(function () {
                            $(this).find('.j_menu_list').show();
                        }, function () {
                            $(this).find('.j_menu_list').hide();
                        });
                    })

                    $(".leftsidebar_box dt").css({ "background-color": "#3992d0" });
                    $(".leftsidebar_box dt img").attr("src", "images/left/select_xl01.png");

                    $(".leftsidebar_box dd").hide();
                    $(".leftsidebar_box dt").click(function () {
                        $(".leftsidebar_box dt").css({ "background-color": "#3992d0" })
                        $(this).css({ "background-color": "#317eb4" });
                        $(this).parent().find('dd').removeClass("menu_chioce");
                        $(".leftsidebar_box dt img").attr("src", "images/left/select_xl01.png");
                        $(this).parent().find('img').attr("src", "images/left/select_xl.png");
                        $(".menu_chioce").slideUp();
                        $(this).parent().find('dd').slideToggle();
                        $(this).parent().find('dd').addClass("menu_chioce");
                    });
                    $("#btn_l").click(function () {
                        $(".leftsidebar_box").animate({ left: "-292px" });
                        $(".leftmenu2").animate({ left: "0px" })
                        $(".contentsidebar_box").css("left", "45px")
                        //$(".contentsidebar_box").css("width", "95%");
                    })
                    $("#btn_r").click(function () {
                        $(".leftsidebar_box").animate({ left: "0px" });
                        $(".leftmenu2").animate({ left: "-192px" });
                        $(".contentsidebar_box").css("left", "168px")
                        //$(".contentsidebar_box").css("width", "90%");
                    });
                    $("#lod_menu").hide();
                });
        }
          
    </script>
    <style>
        .header_menu
        {
            float: right;
            color: #fff;
        }
        .ow_menu
        {
            position: fixed;
            right: 0px;
            top: 35px;
            width: 100px;
            text-align: left;
            background: #fff;
            border: solid 1px #cccaca;
            opacity: 1;
            border-radius: 0 0 5px 5px;
            -moz-border-radius: 0 0 5px 5px;
            -webkit-border-radius: 0 0 5px 5px;
            box-shadow: 0 2px 4px rgba(34, 25, 25, 0.5);
            -moz-box-shadow: 0 2px 4px rgba(34, 25, 25, 0.5);
            -webkit-box-shadow: 0 2px 4px rgba(34, 25, 25, 0.5);
            z-index: 999;
            display: none;
        }
        .menu ul
        {
            width: 100px;
            height: auto;
        }
        .menu li
        {
            width: 100px;
        }
        .menu_aa
        {
            height: 30px;
            width: 120px;
            position: relative;
        }
        .menu_aa:hover
        {
            background: #F2F2F2;
        }
        .menu_aa a
        {
            line-height: 30px;
            text-indent: 2em;
            float: left;
        }
        .navbar-nav
        {
            float: left;
            margin: 0;
            color: #fff;
            line-height: 40px;
        }
        .navbar-nav ul li
        {
        }
        .navbar-nav > li
        {
            float: left;
        }
        
        .nav > li > a
        {
            position: relative;
            display: block;
            padding: 3px 8px;
        }
        .nav > li > a:hover, a:active, a:focus
        {
            outline: none;
            text-decoration: none;
            background-color: #586683;
            cursor: pointer;
        }
        .user-image
        {
            float: left;
            width: 25px;
            height: 25px;
            border-radius: 50%;
            margin-right: 10px;
            margin-top: 8px;
        }
        .fa
        {
            display: inline-block;
            font: normal normal normal 14px/1 FontAwesome;
            font-size: inherit;
            text-rendering: auto;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }
    </style>
</head>
<body scroll="no">
    <div class="header">
        <b><span style="font-size: 18px; color: White;">卡门报表平台</span></b>
        <div class="header_menu">
            <!--当前用户： <a style="font-size: 14px; color: White;" id="lblUserName" href="#"></a>
            <div class="ow_menu">
                <ul>
                    <li>
                        <div class="menu_aa">
                            <a id="btn_center" href="#">个人信息</a></div>
                    </li>
                    <li>
                        <div class="menu_aa">
                            <a id="btnOut" class="menu_aa" href="#">退出</a></div>
                    </li>
                </ul>
            </div>-->
            <ul class="nav navbar-nav">
                <!-- User Account Menu -->
                <li class="user user-menu">
                    <!-- Menu Toggle Button -->
                    <a id="btn_center">
                        <img src="/images/userName.png" class="user-image" alt="User Image">
                        <span id="lblUserName" style="font-size: 14px; color: White;"></span></a>
                </li>
                <li><a id="btnOut" style="font-size: 14px; color: White;">
                    <img src="/images/exit.png" class="user-image" alt="User Image">退出</a></li>
            </ul>
        </div>
    </div>
    <div class="container">
        <div class="leftsidebar_box">
            <div class="line">
            </div>
            <div style="margin-left: 18px; height: 25px; padding: 5px; text-align: center;">
                <span style="font-size: 18px; color: White;">功能菜单</span> <a id="btn_l" href="#" style="padding-left: 55px;
                    color: White;"><</a></div>
            <div id="lod_menu" style="text-align: center; color: White;">
                <img src="images/loading.gif" />菜单加载中...
            </div>
            <!--  <dl class="statistics">
                    <dt onclick="changeImage()">业务报表<img src="images/left/select_xl01.png"></dt>
                    <dd class="first_dd">
                        <a class="a_menu" href="#" url="error.html">销一补一报表</a></dd>
                    <dd>
                        <a class="a_menu" href="#" url="KMrpt1.aspx">每日业绩汇报明细表</a></dd>
                    <dd>
                        <a class="a_menu" href="#" url="KMrpt2.aspx">周销存结构（店）</a></dd>
                    <dd>
                        <a class="a_menu" href="#" url="KMrpt3.aspx">周销存结构（省份）</a></dd>
                    <dd>
                        <a class="a_menu" href="#" url="error.html">本周销售总况</a></dd>
                    <dd>
                        <a class="a_menu" href="#" url="error.html">整体分析</a></dd>
                    <dd>
                        <a class="a_menu" href="#" url="error.html">秋鞋服</a></dd>
                </dl>
                <dl class="custom">
                    <dt onclick="changeImage()">商品分析报表<img src="images/left/select_xl01.png"></dt>
                    <dd class="first_dd">
                        <a href="#">单款跟踪表</a></dd>
                    <dd>
                        <a href="#">单款进销存-总表</a></dd>
                    <dd>
                        <a href="#">单款进销存-店铺</a></dd>
                    <dd>
                        <a href="#">即将到期客户管理</a></dd>
                    <dd>
                        <a href="#">15秋断码率情况</a></dd>
                    <dd>
                        <a href="#">货品销存结构</a></dd>
                </dl>
                <dl class="syetem_management">
                    <dt>平台管理<img src="images/left/select_xl01.png"></dt>
                    <dd class="first_dd">
                        <a target="if_main" href="./SysManager/UserList.aspx">用户管理</a></dd>
                    <dd>
                        <a class="a_menu" href="#" url="./SysManager/Modules.aspx">模块管理</a></dd>
                    <dd>
                        <a href="#">权限管理</a></dd><!--
                    <dd>
                        <a href="#">栏目管理</a></dd>
                    <dd>
                        <a href="#">微官网模板组管理</a></dd>
                    <dd>
                        <a href="#">商城模板管理</a></dd>
                    <dd>
                        <a href="#">微功能管理</a></dd>-->
            <dd>
                <a class="a_menu" href="#" url="./SysManager/LoginLog.aspx">登录日志</a></dd>
            </dl>-->
            <!--                <dl class="channel">
                    <dt>渠道管理<img src="images/left/select_xl01.png"></dt>
                    <dd class="first_dd">
                        <a href="#">渠道主页</a></dd>
                    <dd>
                        <a href="#">渠道标准管理</a></dd>
                    <dd>
                        <a href="#">系统通知</a></dd>
                    <dd>
                        <a href="#">渠道商管理</a></dd>
                    <dd>
                        <a href="#">渠道商链接</a></dd>
                </dl>
                <dl class="app">
                    <dt onclick="changeImage()">APP管理<img src="images/left/select_xl01.png"></dt>
                    <dd class="first_dd">
                        <a href="#">App运营商管理</a></dd>
                    <dd>
                        <a href="#">开放接口管理</a></dd>
                    <dd>
                        <a href="#">接口类型管理</a></dd>
                </dl>
                <dl class="cloud">
                    <dt>大数据云平台<img src="images/left/select_xl01.png"></dt>
                    <dd class="first_dd">
                        <a href="#">平台运营商管理</a></dd>
                </dl>
                <dl class="source">
                    <dt>素材库管理<img src="images/left/select_xl01.png"></dt>
                    <dd class="first_dd">
                        <a href="#">图片库</a></dd>
                    <dd>
                        <a href="#">链接库</a></dd>
                    <dd>
                        <a href="#">推广管理</a></dd>
                </dl>
                <dl class="statistics">
                    <dt>统计分析<img src="images/left/select_xl01.png"></dt>
                    <dd class="first_dd">
                        <a href="#">客户统计</a></dd>
                </dl>-->
        </div>
        <div class="leftmenu2" style="left: -192px;">
            <div style="margin-left: 25px; height: 25px;">
                <a id="btn_r" href="#" style="color: White;">></a></div>
            <ul id="menu_ul">
                <li><a class="j_a_list j_a_list1"></a>
                    <div class="j_menu_list j_menu_list_first" style="display: none;">
                        <span class="sp1"><i></i>业务报表</span> <a class=" a_menu j_lista_first" href="#" url="error.html">
                            销一补一报表</a> <a class="a_menu" href="#" url="KMrpt1.aspx">每日业绩汇报明细表</a> <a class="a_menu"
                                url="KMrpt2.aspx" href="#">周销存结构（店）</a> <a class="a_menu" href="#" url="KMrpt3.aspx">
                                    周销存结构（省份）</a>
                    </div>
                </li>
                <li><a class="j_a_list j_a_list2"></a>
                    <div class="j_menu_list" style="display: none;">
                        <span class="sp2"><i></i>商品分析报表</span> <a href="#">单款跟踪表</a> <a href="#">单款进销存-总表</a>
                        <a href="#">单款进销存-店铺</a> <a href="#">即将到期客户管理</a>
                    </div>
                </li>
            </ul>
        </div>
        <div class="contentsidebar_box" style="left: 168px;">
            <div id="TopMenu">
                <ul>
                    <li id="pageindex" class="tags active">首页</li>
                </ul>
            </div>
            <div id="c_index" class="conents">
                <iframe id="if_main" name="if_main" src="welcome.html"></iframe>
            </div>
        </div>
    </div>
    <div class="bottom_c">
        <div style="float: left; padding-left: 15px;">
            <a id="show-online-btn" href="#" title="点击显示在线列表"><span id="txtonline" style="color: White;">
                当前在线人数：</span></a></div>
        © 2015 <a href="#">KM</a>&nbsp;&nbsp; @温馨提示：本系统由信息部自主开发，如有问题请及时联系信息部开发人员：梅浩（18664827872）。
    </div>
    <div id="up_pwd" style="display:none;">
    <div>
        <span style="color:Red;">提示：安全问题，第一次登录必须修改密码！</span>
    </div>
        <div>
            <ul>
                <li>新密码</li>
                <li>
                    <input type="password" id="txtpwd" placeholder="输入密码" /></li>
            </ul>
        </div>
        <div>
            <ul>
                <li>再次输入</li>
                <li>
                    <input type="password" id="txtpwd2" placeholder="重新输入" /></li>
            </ul>
        </div>
    </div>
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript">
        $(".leftsidebar_box dt").css({ "background-color": "#3992d0" });
        $(".leftsidebar_box dt img").attr("src", "images/left/select_xl01.png");
        $(function () {
            $(".leftsidebar_box dd").hide();
            $(".leftsidebar_box dt").click(function () {
                $(".leftsidebar_box dt").css({ "background-color": "#3992d0" })
                $(this).css({ "background-color": "#317eb4" });
                $(this).parent().find('dd').removeClass("menu_chioce");
                $(".leftsidebar_box dt img").attr("src", "images/left/select_xl01.png");
                $(this).parent().find('img').attr("src", "images/left/select_xl.png");
                $(".menu_chioce").slideUp();
                $(this).parent().find('dd').slideToggle();
                $(this).parent().find('dd').addClass("menu_chioce");
            });

            $('#show-online-btn').click(function () {
                var html = '<div class="qq-client-list">';
                $.post(url_path + "/index.aspx",
                    { aciton: 'GetUserOnlineList' },
                     function (data) {
                         var msg = $.trim(data);
                         if (msg == "NOUSER") {
                         } else {
                             var orderObj = JSON.parse(msg);
                             for (var i = 0; i < orderObj.length; i++) {
                                 html += '<div class="client-list"><a href="#"><label>' + orderObj[i].UserName + '  ' + orderObj[i].OSName + '[在线]</label></a> </div>';
                             }
                             html += '</div>';
                             iDialog({
                                 lock: true,
                                 title: '在线用户列表',
                                 width: 220,
                                 height: 400,
                                 top: $('.bottom_c').offset().top - 400,
                                 left: 0,
                                 show: function () {
                                     this.$content.html(html);
                                 }
                             });
                         }

                     });

            });

        })
    </script>
    <style>
        .qq-client-list
        {
            background: #ffffff;
            overflow-y: auto;
            height: 320px;
        }
        .client-list
        {
            overflow: hidden;
            line-height: 40px;
            width: 90%;
            margin: 0px auto;
            border-bottom: dashed 1px #ebebeb;
        }
        .client-list a:hover
        {
            color: red;
        }
        #up_pwd
        {
            padding: 2px;
            width: 100%;
            height: 80px;
        }
        #up_pwd div
        {
            width: 100%;
            height: 30px;
            line-height: 30px;
        }
        #up_pwd li
        {
            min-width: 60px;
            float: left;
        }
    </style>
</body>
</html>
